package cn.com.dycc.sys_manage.deptsysmanagement.entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;

import cn.com.dycc.sys_manage.area.entity.AreaInfo;
import cn.com.dycc.sys_manage.dictionarysysmanagement.entity.DictionaryInfo;
import cn.com.dycc.sys_manage.usersysmanagement.entity.UserInfo;

public class DeptResult implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5683949538967321314L;
	
	private String dept_no;			//单位序号
	private String dept_name;		//单位名称
	private String dept_info;		//单位信息
	private String pid;				//父节点
//	private String hidden;			//启用标志
	private String area_id;		    //所属区域
	private String dept_addr;		//单位地址
	private String dept_per;		//单位联系人
	private String dept_tel;		//单位电话
	private Integer order_no;		//排列顺序
	private String remark;			//备注
	private String dept_flag;		//单位标识
	private String state;			//可用标识
	private String org_id;			//组织标识
	private Timestamp create_date;	//创建时间
	private String opt_user_id;		//创建人
	private Date update_date; 		//更新时间
	private String update_user_id;	//更新人
	
	private AreaInfo area;				//接收单位所在地
	private DictionaryInfo dept_flag_dic;	//接收单位标识 /*0 业主单位   1 监理单位*/
	private UserInfo createUser;		//接收创建人
	private UserInfo updateUser;		//接收更新人
	private DictionaryInfo state_dic;			//接收上是否启用/
	private DeptInfo pid_dept;					//接收pid
	
	public List<DeptResult> children;		//接收子部门
	
	public DeptResult(){}

	public DeptResult(String dept_no, String dept_name, String dept_info, String pid, String area_id, String dept_addr,
			String dept_per, String dept_tel, Integer order_no, String remark, String dept_flag, String state,
			String org_id, Timestamp create_date, String opt_user_id, Date update_date, String update_user_id,
			AreaInfo area, DictionaryInfo dept_flag_dic, UserInfo createUser, UserInfo updateUser,
			DictionaryInfo state_dic, DeptInfo pid_dept, List<DeptResult> children) {
		super();
		this.dept_no = dept_no;
		this.dept_name = dept_name;
		this.dept_info = dept_info;
		this.pid = pid;
		this.area_id = area_id;
		this.dept_addr = dept_addr;
		this.dept_per = dept_per;
		this.dept_tel = dept_tel;
		this.order_no = order_no;
		this.remark = remark;
		this.dept_flag = dept_flag;
		this.state = state;
		this.org_id = org_id;
		this.create_date = create_date;
		this.opt_user_id = opt_user_id;
		this.update_date = update_date;
		this.update_user_id = update_user_id;
		this.area = area;
		this.dept_flag_dic = dept_flag_dic;
		this.createUser = createUser;
		this.updateUser = updateUser;
		this.state_dic = state_dic;
		this.pid_dept = pid_dept;
		this.children = children;
	}

	public String getDept_no() {
		return dept_no;
	}

	public void setDept_no(String dept_no) {
		this.dept_no = dept_no;
	}

	public String getDept_name() {
		return dept_name;
	}

	public void setDept_name(String dept_name) {
		this.dept_name = dept_name;
	}

	public String getDept_info() {
		return dept_info;
	}

	public void setDept_info(String dept_info) {
		this.dept_info = dept_info;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getArea_id() {
		return area_id;
	}

	public void setArea_id(String area_id) {
		this.area_id = area_id;
	}

	public String getDept_addr() {
		return dept_addr;
	}

	public void setDept_addr(String dept_addr) {
		this.dept_addr = dept_addr;
	}

	public String getDept_per() {
		return dept_per;
	}

	public void setDept_per(String dept_per) {
		this.dept_per = dept_per;
	}
	
	public String getDept_tel() {
		return dept_tel;
	}

	public void setDept_tel(String dept_tel) {
		this.dept_tel = dept_tel;
	}

	public Integer getOrder_no() {
		return order_no;
	}

	public void setOrder_no(Integer order_no) {
		this.order_no = order_no;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getDept_flag() {
		return dept_flag;
	}

	public void setDept_flag(String dept_flag) {
		this.dept_flag = dept_flag;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getOrg_id() {
		return org_id;
	}

	public void setOrg_id(String org_id) {
		this.org_id = org_id;
	}
	
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	public Timestamp getCreate_date() {
		return create_date;
	}

	public void setCreate_date(Timestamp create_date) {
		this.create_date = create_date;
	}

	public String getOpt_user_id() {
		return opt_user_id;
	}

	public void setOpt_user_id(String opt_user_id) {
		this.opt_user_id = opt_user_id;
	}
	
	@JsonFormat(pattern="yyyy-MM-dd")
	public Date getUpdate_date() {
		return update_date;
	}

	public void setUpdate_date(Date update_date) {
		this.update_date = update_date;
	}

	public String getUpdate_user_id() {
		return update_user_id;
	}

	public void setUpdate_user_id(String update_user_id) {
		this.update_user_id = update_user_id;
	}

	public AreaInfo getArea() {
		return area;
	}

	public void setArea(AreaInfo area) {
		this.area = area;
	}

	public DictionaryInfo getDept_flag_dic() {
		return dept_flag_dic;
	}

	public void setDept_flag_dic(DictionaryInfo dept_flag_dic) {
		this.dept_flag_dic = dept_flag_dic;
	}

	public UserInfo getCreateUser() {
		return createUser;
	}

	public void setCreateUser(UserInfo createUser) {
		this.createUser = createUser;
	}

	public UserInfo getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(UserInfo updateUser) {
		this.updateUser = updateUser;
	}

	public DictionaryInfo getState_dic() {
		return state_dic;
	}

	public void setState_dic(DictionaryInfo state_dic) {
		this.state_dic = state_dic;
	}

	public DeptInfo getPid_dept() {
		return pid_dept;
	}

	public void setPid_dept(DeptInfo pid_dept) {
		this.pid_dept = pid_dept;
	}

	public List<DeptResult> getChildren() {
		return children;
	}

	public void setChildren(List<DeptResult> children) {
		this.children = children;
	}

	@Override
	public String toString() {
		return "DeptResult [dept_no=" + dept_no + ", dept_name=" + dept_name + ", dept_info=" + dept_info + ", pid="
				+ pid + ", area_id=" + area_id + ", dept_addr=" + dept_addr + ", dept_per=" + dept_per + ", dept_tel="
				+ dept_tel + ", order_no=" + order_no + ", remark=" + remark + ", dept_flag=" + dept_flag + ", state="
				+ state + ", org_id=" + org_id + ", create_date=" + create_date + ", opt_user_id=" + opt_user_id
				+ ", update_date=" + update_date + ", update_user_id=" + update_user_id + ", area=" + area
				+ ", dept_flag_dic=" + dept_flag_dic + ", createUser=" + createUser + ", updateUser=" + updateUser
				+ ", state_dic=" + state_dic + ", pid_dept=" + pid_dept + ", children=" + children + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((dept_no == null) ? 0 : dept_no.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DeptResult other = (DeptResult) obj;
		if (dept_no == null) {
			if (other.dept_no != null)
				return false;
		} else if (!dept_no.equals(other.dept_no))
			return false;
		return true;
	}

	
	
}
